﻿using System;

namespace BizElements.Core.ProviderComponents
{
    sealed class GenericParameterRenderer : IParameterRenderer
    {
        #region RenderParameterName - "?" is always returned since ODBC and OLE drivers don't support named parameters.

        public string RenderParameterName(DbParameter parameter)
        {
            // ODBC and OLE drivers don't support named parameters.
            return "?";
        }

        #endregion

        #region GetUniqueName - index is appended to original/initial parameter name.

        public string GetUniqueName(string originalParameterName, int parameterIndexInCollection)
        {
            return originalParameterName + "_" + parameterIndexInCollection;
        }

        #endregion
    }
}